<include file="public/layout" />
<style>
    td{height:40px;line-height:40px; padding-left:20px;}
    .span_1{
        float:left;
        margin-left:0px;
        height:130px;
        line-height:130px;
    }
    .span_1 ul{list-style:none;padding:0px;}
    .span_1 ul li{
        border:1px solid #CCC;
        height:40px;
        padding:0px 10px;
        margin-left:-1px;
        margin-top:-1px;
        line-height:40px;
    }
</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>会员管理 - 会员信息</h3>
                <h5>网站系统会员管理会员信息</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="user_form" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label>会员昵称</label>
                </dt>
                <dd class="opt">
                    <input class="input-txt valid" name="nickname" value="{$user.nickname}" readonly="" type="text">
                    <p class="notic">会员昵称不可修改。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>用户积分</label>
                </dt>
                <dd class="opt"><strong class="red">{$user.pay_points}</strong>&nbsp;积分 </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>账户余额</label>
                </dt>
                <dd class="opt"><strong class="red">{$user.user_money}</strong>&nbsp;元 </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="email"><em>*</em>电子邮箱</label>
                </dt>
                <dd class="opt">
                    <input id="email"  name="email" value="{$user.email}" class="input-txt" type="text">
                    <span class="err"></span>
                    <p class="notic">请输入常用的邮箱，将用来找回密码、接受订单通知等。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="mobile"><em>*</em>手机号码</label>
                </dt>
                <dd class="opt">
                    <input id="mobile"  name="mobile" value="{$user.mobile}" class="input-txt" type="text">
                    <span class="err"></span>
                    <p class="notic">请输入常用的手机号码，将用来找回密码、接受订单通知等。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="password">新密码</label>
                </dt>
                <dd class="opt">
                    <input id="password" name="password" class="input-txt" type="text">
                    <span class="err"></span>
                    <p class="notic">留空表示不修改密码</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="password2">确认密码</label>
                </dt>
                <dd class="opt">
                    <input id="password2" name="password2" class="input-txt" type="text">
                    <span class="err"></span>
                    <p class="notic">留空表示不修改密码</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>性别</label>
                </dt>
                <dd class="opt">
                    <input value="0" name="sex" id="member_sex0" type="radio" <if condition="$user['sex'] eq 0">checked</if>>
                    <label for="member_sex0">保密</label>
                    <input value="1" name="sex" id="member_sex1" type="radio" <if condition="$user['sex'] eq 1">checked</if>>
                    <label for="member_sex1">男</label>
                    <input value="2" name="sex" id="member_sex2" type="radio" <if condition="$user['sex'] eq 2">checked</if>>
                    <label for="member_sex2">女</label>
                    <span class="err"></span> </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label class="qq">QQ</label>
                </dt>
                <dd class="opt">
                    <input id="qq" name="qq" value="{$user.qq}" class="input-txt" type="text">
                    <span class="err"></span> </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>注册时间</label>
                </dt>
                <dd class="opt">{$user.reg_time|date='Y-m-d H:i',###}</dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>冻结会员</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="is_lock1" class="cb-enable <if condition="$user['is_lock'] eq 1">selected</if>"><span>开启</span></label>
                        <label for="is_lock2" class="cb-disable <if condition="$user['is_lock'] eq 0">selected</if>"><span>关闭</span></label>
                        <input id="is_lock1" name="is_lock" value="1" type="radio" <if condition="$user['is_lock'] eq 1">checked</if>>
                        <input id="is_lock2" name="is_lock" value="0" type="radio" <if condition="$user['is_lock'] eq 0">checked</if>>
                    </div>
                    <p class="notic">如果冻结会员，会员将不能操作资金。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>分销功能</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="is_distribut1" class="cb-enable <if condition="$user['is_distribut'] eq 1">selected</if>"><span>开启</span></label>
                        <label for="is_distribut2" class="cb-disable <if condition="$user['is_distribut'] eq 0">selected</if>"><span>关闭</span></label>
                        <input id="is_distribut1" name="is_distribut" value="1" type="radio" <if condition="$user['is_distribut'] eq 1">checked</if>>
                        <input id="is_distribut2" name="is_distribut" value="0" type="radio" <if condition="$user['is_distribut'] eq 0">checked</if>>
                    </div>
                    <p class="notic">如果开启，会员参与分销。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>顾问／策划师</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="is_counselor1" class="cb-enable <if condition="$user['is_counselor'] eq 1">selected</if>"><span>是</span></label>
                        <label for="is_counselor2" class="cb-disable <if condition="$user['is_counselor'] eq 0">selected</if>"><span>否</span></label>
                        <input id="is_counselor1" name="is_counselor" value="1" type="radio" <if condition="$user['is_counselor'] eq 1">checked</if>>
                        <input id="is_counselor2" name="is_counselor" value="0" type="radio" <if condition="$user['is_counselor'] eq 0">checked</if>>
                    </div>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                </dt>
                <dd class="opt">
                    <div style="height:160px;">
                        <span class="span_1">
                            <ul>
                                <li>用户余额</li>
                                <li>上一级编号</li>
                                <li>上二级编号</li>
                                <li>上三级编号</li>
                            </ul>
                        </span>
                        <span class="span_1">
                            <ul>
                                <li><strong class="red">{$user.user_money}</strong>&nbsp;元 </li>
                                <li>
                                    <if condition='$user[first_leader] gt 0'>
                                        <a href="{:U(detail,array('id'=>$user[first_leader]))}">{$user.first_leader}</a>
                                        <else/>
                                        {$user.first_leader}
                                    </if>
                                </li>
                                <li>
                                    <if condition='$user[second_leader] gt 0'>
                                        <a href="{:U(detail,array('id'=>$user[second_leader]))}">{$user.second_leader}</a>
                                        <else />
                                        {$user.second_leader}
                                    </if>
                                </li>
                                <li>
                                    <if condition='$user[third_leader] gt 0'>
                                        <a href="{:U(detail,array('id'=>$user[third_leader]))}">{$user.third_leader}</a>
                                        <else />
                                        {$user.third_leader}
                                    </if>
                                </li>
                            </ul>
                        </span>
                        <span class="span_1">
                            <ul>
                                <li>累积分佣金额</li>
                                <li>一级下线数</li>
                                <li>二级下线数</li>
                                <li>三级下线数</li>
                            </ul>
                        </span>
                        <span class="span_1">
                            <ul>
                                <li><strong class="red">{$user.distribut_money}</strong>&nbsp;元 </li>
                                <li>
                                    <if condition='$user[first_lower] gt 0'>
                                        <a href="{:U(index,array('first_leader'=>$user[user_id]))}">{$user.first_lower}</a>
                                        <else />
                                        {$user.first_lower}
                                    </if>
                                </li>
                                <li>
                                    <if condition='$user[second_lower] gt 0'>
                                        <a href="{:U(index,array('second_leader'=>$user[user_id]))}">{$user.second_lower}</a>
                                        <else />
                                        {$user.second_lower}
                                    </if>
                                </li>
                                <li>
                                    <if condition='$user[third_lower] gt 0'>
                                        <a href="{:U(index,array('third_leader'=>$user[user_id]))}">{$user.third_lower}</a>
                                        <else />
                                        {$user.third_lower}
                                    </if>
                                </li>
                            </ul>
                        </span>
                        <div style="clear:both;"></div>
                    </div>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="checkUserUpdate();" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function checkUserUpdate(){
        var email = $('input[name="email"]').val();
        var mobile = $('input[name="mobile"]').val();
        var password = $('input[name="password"]').val();
        var password2 = $('input[name="password2"]').val();

        var error ='';
        if(password != password2){
            error += "两次密码不一样\n";
        }
        if(!checkEmail(email) && email != ''){
            error += "邮箱地址有误\n";
        }
        if(!checkMobile(mobile) && mobile != ''){
            error += "手机号码填写有误\n";
        }
        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        $('#user_form').submit();
    }
</script>
</body>
</html>